package com.saifan.wyy_ov.common;


import android.os.Bundle;
import android.support.v4.app.Fragment;


import com.saifan.wyy_ov.data.bean.RoomInfoBean;

import lomasky.ma.httpUtils.JsonUtil;
import lomasky.ma.utils.SharedPrefUtil;


/**
 * Created by ma on 2015/5/23.
 */
public abstract class BaseFragment extends Fragment {





    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        roomInfoBean = JsonUtil.getObject(SharedPrefUtil.getString(getActivity(),"roomInfo", ""), RoomInfoBean.class);
    }

    public RoomInfoBean getRoomInfoBean() {
        if(roomInfoBean==null){
            roomInfoBean = JsonUtil.getObject(SharedPrefUtil.getString(getActivity(),"roomInfo", ""), RoomInfoBean.class);

        }
        return roomInfoBean;
    }

    public void setRoomInfoBean(RoomInfoBean roomInfoBean) {

        SharedPrefUtil.putString(getActivity(),"roomInfo", JsonUtil.toJson( roomInfoBean));
        this.roomInfoBean = roomInfoBean;

    }




    public RoomInfoBean roomInfoBean;
}
